{% extends 'template.html' %}

{% block username %}
    {{ request.user.username }}
{% endblock %}

{% block content %}
    <div id="page-wrapper">
        <div class="row">
            <div class="col-lg-12">
                <h1 class="page-header">主机变更汇总</h1>
            </div>
        </div>
        <div class="row">
            <div class="col-lg-12">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <div class="col-sm-2">
                            <label>变更类型</label>
                            <select id="filter_type" style="width: 100%">
                                <option value="0" selected>全部</option>
                                {% for t in type %}
                                    <option value="{{ t.0 }}">{{ t.1 }}</option>
                                {% endfor %}
                            </select>
                        </div>
                        <div class="col-sm-2">
                            <label>操作人</label>
                            <select id="filter_operation_user" style="width: 100%">
                                <option value="0" selected>全部</option>
                                {% for u in all_users %}
                                    <option value="{{ u.id }}">{{ u.username }}</option>
                                {% endfor %}
                            </select>
                        </div>
                        <div class="col-sm-2">
                            <label>主机IP</label>
                            <input id="filter_host_ip" class="form-control column_filter">
                        </div>
                        <div class="col-sm-2">
                            <label>来源IP</label>
                            <input id="filter_source_ip" class="form-control column_filter">
                        </div>
                        <div class="col-sm-2">
                            <br>
                            <button class="btn btn-success" id="bt-reset">重置</button>
                        </div>
                        <br><br><br>
                    </div>
                    <div class="panel-body">
                        <table id="mytable" class="display" width="100%" cellspacing="0">
                            <thead>
                            <tr>
                                <th>id</th>
                                <th>项目</th>
                                <th>机房</th>
                                <th>业务类型</th>
                                <th>主机IP</th>
                                <th>操作时间</th>
                                <th>操作人</th>
                                <th>变更类型</th>
                                <th>变更字段</th>
                                <th>变更前</th>
                                <th>变更后</th>
                                <th>备注</th>
                                <th>变更来源IP</th>
                            </tr>
                            </thead>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
{% endblock %}
{% block bodyjs %}
    <script src="/static/js/jquery.dataTables.js"></script>
    {{ django_context_varable }}
    {% verbatim %}
    <script id="tpl" type="text/x-handlebars-template">
        {{#each func}}
        <button type="button" class="btn btn-{{this.type}} btn-sm" onclick="{{this.fn}}">{{this.name}}</button>
        {{/each}}
    </script>
    {% endverbatim %}
    <script src="/static/js/handlebars-v3.0.1.js"></script>
    <script src="/static/js/host_trace.js?v=20190911001"></script>
{% endblock %}
{% block css %}
    <link href="/static/css/jquery.dataTables.css" rel="stylesheet" type="text/css">
    <link href="/static/css/mycss.css" rel="stylesheet" type="text/css">
    <link href="/static/css/select2-bootstrap.css" rel="stylesheet" type="text/css">
{% endblock %}
